Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add ECS task for RedwoodJS console #38

Merged
merged 15 commits into from
Dec 8, 2023
Merged

Conversation

TylerHendrickson
Copy link
Member

This PR adds IAC for provisioning infrastructure that runs a RedwoodJS console container within an AWS ECS cluster. It also updates CI/CD workflows to build and publish these images.

The purpose of these changes is to allow the existence of a bastion-like facility in AWS deployment environments, which is especially useful for running database migrations without needing to expose databases in these environments to the public internet. ECS was chosen as the compute service instead of EC2 mainly for two reasons:

  1. We have existing patterns (in the usdr-gost repo) for serving this type of use-case with ECS tasks.
  2. As a more serverless type of offering, ECS affords lower management overhead for the infrastructure (e.g. no OS updates to apply).

In the future, we might explore ways to manage Prisma migrations using Lambda, which would require even less management overhead and would also be much cheaper. However, support for running Prisma commands in a library-based, programmatic manner is limited, and using Lambda functions to run Prisma migrations is explicitly not recommended in their documentation. This by no means should bar us from exploring this option, but in the interest of expediency, using ECS seems like a decent solution in the meantime.

@TylerHendrickson TylerHendrickson self-assigned this Dec 8, 2023
@TylerHendrickson TylerHendrickson requested a review from a team as a code owner December 8, 2023 00:30
Copy link

github-actions bot commented Dec 8, 2023

QA Summary

QA Check Result
🌐 Web Tests
🔗 API Tests
📏 ESLint
🧹 TFLint

Test Coverage

Coverage report for api suite
St File % Stmts % Branch % Funcs % Lines Uncovered Line #s
🟡 All files 59.7 33.33 68.18 59.7
🟢  directives/requireAuth 100 100 100 100
🟢   requireAuth.ts 100 100 100 100
🟡  directives/skipAuth 50 100 0 50
🟡   skipAuth.ts 50 100 0 50 13
🔴  functions 0 100 0 0
🔴   graphql.ts 0 100 0 0 13-20
🔴  graphql 0 100 100 0
🔴   agencies.sdl.ts 0 100 100 0 1
🔴   organizations.sdl.ts 0 100 100 0 1
🔴  lib 40.74 50 57.14 40.74
🟢   auth.ts 83.33 100 66.66 83.33 15
🔴   db.ts 31.25 50 50 31.25 15-35,45,47
🟢   logger.ts 100 100 100 100
🔴   tracer.ts 0 100 100 0 5-14
🟡  services/agencies 70.58 0 83.33 70.58
🟢   agencies.scenarios.ts 100 100 100 100
🟡   agencies.ts 68.75 0 83.33 68.75 40-48
🟢  services/organizations 92.3 100 83.33 92.3
🟢   organizations.scenarios.ts 100 100 100 100
🟢   organizations.ts 91.66 100 83.33 91.66 47
Coverage report for web suite
St File % Stmts % Branch % Funcs % Lines Uncovered Line #s
🔴 All files 15.42 29.41 10.52 15.64
🔴  src 15.38 0 50 15.38
🔴   App.tsx 0 0 0 0 3-32
🟢   Routes.tsx 100 100 100 100
🔴   entry.client.tsx 0 0 100 0 10-22
🔴  src/components/Agency/Agencies 0 100 0 0
🔴   Agencies.tsx 0 100 0 0 9-21
🔴  src/components/Agency/AgenciesCell 0 100 0 0
🔴   AgenciesCell.tsx 0 100 0 0 8-39
🔴  src/components/Agency/Agency 0 0 0 0
🔴   Agency.tsx 0 0 0 0 10-78
🔴  src/components/Agency/AgencyCell 0 100 0 0
🔴   AgencyCell.tsx 0 100 0 0 7-27
🔴  src/components/Agency/AgencyForm 0 0 0 0
🔴   AgencyForm.tsx 0 0 0 0 24-39
🔴  src/components/Agency/EditAgencyCell 0 100 0 0
🔴   EditAgencyCell.tsx 0 100 0 0 10-58
🔴  src/components/Agency/NewAgency 0 100 0 0
🔴   NewAgency.tsx 0 100 0 0 9-35
🔴  src/components/Organization/EditOrganizationCell 0 100 0 0
🔴   EditOrganizationCell.tsx 0 100 0 0 13-62
🔴  src/components/Organization/NewOrganization 0 100 0 0
🔴   NewOrganization.tsx 0 100 0 0 9-35
🔴  src/components/Organization/Organization 0 0 0 0
🔴   Organization.tsx 0 0 0 0 10-70
🔴  src/components/Organization/OrganizationCell 0 100 0 0
🔴   OrganizationCell.tsx 0 100 0 0 7-27
🔴  src/components/Organization/OrganizationForm 0 0 0 0
🔴   OrganizationForm.tsx 0 0 0 0 27-41
🔴  src/components/Organization/Organizations 0 100 0 0
🔴   Organizations.tsx 0 100 0 0 9-21
🔴  src/components/Organization/OrganizationsCell 0 100 0 0
🔴   OrganizationsCell.tsx 0 100 0 0 8-37
🟡  src/layouts/ScaffoldLayout 50 100 0 50
🟡   ScaffoldLayout.tsx 50 100 0 50 10
🟢  src/lib 100 100 100 100
🟢   formatters.tsx 100 100 100 100
🔴  src/pages/Agency/AgenciesPage 0 100 0 0
🔴   AgenciesPage.tsx 0 100 0 0 7-11
🔴  src/pages/Agency/AgencyPage 0 100 0 0
🔴   AgencyPage.tsx 0 100 0 0 7-8
🔴  src/pages/Agency/EditAgencyPage 0 100 0 0
🔴   EditAgencyPage.tsx 0 100 0 0 7-8
🔴  src/pages/Agency/NewAgencyPage 0 100 0 0
🔴   NewAgencyPage.tsx 0 100 0 0 3-4
🔴  src/pages/FatalErrorPage 0 0 0 0
🔴   FatalErrorPage.tsx 0 0 0 0 15
🔴  src/pages/NotFoundPage 0 100 0 0
🔴   NotFoundPage.tsx 0 100 0 0 2
🔴  src/pages/Organization/EditOrganizationPage 0 100 0 0
🔴   EditOrganizationPage.tsx 0 100 0 0 7-8
🔴  src/pages/Organization/NewOrganizationPage 0 100 0 0
🔴   NewOrganizationPage.tsx 0 100 0 0 3-4
🔴  src/pages/Organization/OrganizationPage 0 100 0 0
🔴   OrganizationPage.tsx 0 100 0 0 7-8
🔴  src/pages/Organization/OrganizationsPage 0 100 0 0
🔴   OrganizationsPage.tsx 0 100 0 0 7-8

Pusher: @TylerHendrickson, Action: pull_request_target, Workflow: Continuous Integration

@TylerHendrickson TylerHendrickson merged commit 35ccc89 into main Dec 8, 2023
12 of 15 checks passed
@TylerHendrickson TylerHendrickson deleted the feat/add-ecs-console-task branch December 8, 2023 03:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants